package Imp.mappers;

import entity.Order;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;

@Mapper
public interface usemapper {
    int getLastInsertId();
    void addOrder(@Param("itemid") Integer itemid,
                 @Param("userid") Integer userid,
                 @Param("price") Integer price,
                 @Param("number") int number,
                 @Param("order_time") LocalDateTime order_time,
                 @Param("check_pay") int check_pay
    );
    void subtractUserMoney(@Param("money") float money,
                           @Param("userid") Integer userid,
                           @Param("change_time") LocalDateTime change_time);

    Order getOrder(@Param("orderId") int orderId);
    void setOrderToPay(@Param("orderId") int orderId);
}
